package com.qhs.sys.mapper;

import com.qhs.sys.entity.SysMenuInfo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface SysMenuInfoMapper {
    int deleteByPrimaryKey(Long menuId);

    int insert(SysMenuInfo record);

    int insertSelective(SysMenuInfo record);

    SysMenuInfo selectByPrimaryKey(Long menuId);

    int updateByPrimaryKeySelective(SysMenuInfo record);

    int updateByPrimaryKey(SysMenuInfo record);

    List<SysMenuInfo> findMenuByWhere(SysMenuInfo record);

    /**
     * 获取用户的可操作菜单
     *
     * @param userName
     * @return
     */
    List<SysMenuInfo> findMenuByUser(String userName);

    /**
     * 获取用户的可操作资源
     *
     * @param userId
     * @return
     */
    List<SysMenuInfo> findResourceByUserId(Long userId);

    /**
     * 根据角色菜单
     * @param roleId
     * @return
     */
    List<SysMenuInfo> findMenuByRole(Long roleId);

    List selectTopMenu();

    int selectTopSort();

    int selectParentSort(Long parentId);

    List<SysMenuInfo> findMenuByUserId(Long userId);
}